package org.ysh.core.utils;

import org.ysh.core.cache.Constants;
import org.ysh.domain.User;

public abstract class ShiroUtils {

    public static User getCurrentUser() {
        return (User)ServletUtils.getRequest().getSession().getAttribute(Constants.CURRENT_USER);
    }

    public static Integer getCurrentUserId() {
        if(getCurrentUser() != null) {
            return getCurrentUser().getId();
        }
        return null;
    }
}
